#ifndef DEF_H
#define DEF_H
#define ADDRESS_BIT_SIZE 32
#define BIT_PER_BYTE 8
#define WORD_SIZE (ADDRESS_BIT_SIZE/BIT_PER_BYTE)
#define GET_BYTES_OF_LINES(n) ((n)*WORD_SIZE)
#define STACK_BYTE_SIZE 72
#define OFFSET_RET_ADDR (STACK_BYTE_SIZE-GET_BYTES_OF_LINES(2))
#define OFFSET_FRAME_POINTER (OFFSET_RET_ADDR - WORD_SIZE)
#define OFFSET_GLOBAL_POINTER (OFFSET_FRAME_POINTER - WORD_SIZE)
#define OFFSET_ARGUMENTS STACK_SIZE
#define OFFSET_LOCAL_AND_TEMP_AREA 16
#define BUFFER_SIZE 10
#define POS_LAST_CHAR (OFFSET_LOCAL_AND_TEMP_AREA+WORD_SIZE)
#define LAST_CHAR 0
#define POS_BUFFER_RETURN (OFFSET_LOCAL_AND_TEMP_AREA+ GET_BYTES_OF_LINES(8))
#define END_VAL -1
#define ADDU_TO_LINE_IN_LTA(LINE_ID,LINE_DEST,VALUE)\
	lw	t0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_ID)($fp);\
	addu	t0,t0,(VALUE);	\
	sw	t0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_DEST)($fp);
#define SLL_OF_LINE_IN_LTA(LINE_ID,LINE_DEST,SHIFT_AMOUNT)\
	lw	t0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_ID)($fp);\
	sll	t0,t0,(SHIFT_AMOUNT);	\
	sw	t0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_DEST)($fp);
#define COPY_TO_LINE_USING_V0(LINE_ID,LINE_DEST)\
	lw	v0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_ID)($fp);\
	sw	v0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_DEST)($fp);		
#define COPY_TO_LINE_USING_T0(LINE_ID,LINE_DEST)\
	lw	t0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_ID)($fp);\
	sw	t0,OFFSET_LOCAL_AND_TEMP_AREA+GET_BYTES_OF_LINES(LINE_DEST)($fp);
#endif
